package com.example.cshaoshao.demo.activities;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import android.widget.Toast;

import com.example.cshaoshao.demo.R;
import com.example.cshaoshao.demo.entities.Data;
import com.example.cshaoshao.demo.utils.LogUtil;

import java.util.List;

/**
 * Created by cshaoshao on 2017/6/25.
 */

public class DataActivity extends AppCompatActivity
{
    private TextView textView;
    private Data data=new Data();
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView= (TextView) findViewById(R.id.textview3);
        data.setCallBackParm(new Data.CallBackParm() {
            @Override
            public void successful(List<String> list)
            {
                textView.setText(list+"");
                LogUtil.d("Thread","1");
            }

            @Override
            public void failed(String e)
            {
                Toast.makeText(DataActivity.this,e,Toast.LENGTH_SHORT).show();
                LogUtil.d("Thread","7");
            }
        });
        LogUtil.d("Thread","2");
        data.getData();
        LogUtil.d("Thread","6");

    }
}
